<template>
  <div>
    <div ref="text" v-if="isShow" >前端高薪</div>
    <button v-else @click="changeText">点击修改内容</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isShow: false,
    };
  },
  methods: {
    changeText(){
      this.isShow = true
      this.$nextTick(()=>{
        //vue是异步的 跟定时器效果一样
        this.$refs.text.innerHTML ='来了老弟'
      })
    }
  },
};
</script>

<style></style>
